# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=pkt2flow
pkgver=82.e4cd57b
pkgrel=1
groups=('blackarch' 'blackarch-networking')
pkgdesc='A simple utility to classify packets into flows.'
arch=('x86_64' 'aarch64')
url='https://github.com/caesar0301/pkt2flow'
license=('MIT')
depends=('libpcap')
makedepends=('git' 'scons')
source=("git+https://github.com/caesar0301/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  scons -Q PREFIX=/usr
}

package() {
  cd $pkgname

  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

